-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moved pre-processing step to Core ML class #25
Conversation
@@ -72,6 +72,11 @@ class PredictionLayer: NSObject { | |||
} | |||
onComplete(request) | |||
}) | |||
|
|||
/// Set center cropping for the expected image size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbeissinger comment code here for your review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep looks good
@@ -37,11 +37,7 @@ class PlayViewModel: ObservableObject { | |||
.compactMap { $0 } // remove non-nill values | |||
.receive(on: DispatchQueue.global(qos: .userInitiated)) | |||
.sink(receiveValue: { [weak self] image in | |||
guard let squaredImage = image.squared() else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That little bugger 😛
@@ -72,6 +72,11 @@ class PredictionLayer: NSObject { | |||
} | |||
onComplete(request) | |||
}) | |||
|
|||
/// Set center cropping for the expected image size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep looks good
This PR offloads image preprocessing to the Vision class in Core ML. This should make us better prepared for possible changes to expected image input size in the future.
Because:
This commit:
.centerCrop
to theVNCoreMLRequest
object.LobeML
file in the project menu, for kicks.Tagging #22 because there's a chance that bug gets fixed with this change.